package com.gztms.usermgnt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gztms.usermgnt.pojo.Menu;
import com.gztms.usermgnt.pojo.SysRole;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author Zoey
 * @date 2023/3/27 22:26
 * @Description TODO
 **/
@Mapper
public interface RoleMapper extends BaseMapper<SysRole> {
    List<String> selectRoleCode(String uid);

    /**
     * 添加用户角色关系表
     * @param uid
     * @param roleId
     * @return
     */
    @Insert("INSERT INTO sys_user_role\n" +
            "VALUES\n" +
            "(default,#{uid},#{roleId})")
    Integer addRoleByUid(String uid, int roleId);
}
